<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/struts-bean" prefix="bean"%>
<%@ taglib uri="/WEB-INF/tld/struts-html" prefix="html"%>
<%@ taglib uri="/WEB-INF/tld/struts-logic" prefix="logic"%>
<%@ taglib uri="/WEB-INF/tld/jstl/c" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html lang="true">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<meta http-equiv="keywords" content="ebb365,ebb365,ebb365">
	<meta http-equiv="description" content="ebb365">
	<title>普通会员管理</title>
	<link rel="stylesheet" type="text/css" href="/admin/css/css.css"></link>
	<script language="JavaScript">
<!--//
		function selectAll(choice) {
			for (var i=0;i<document.theForm.checkboxparam.length;i++) {
				var e=document.theForm.checkboxparam[i];
				if(choice==1)e.checked=true;
				if(choice==2)e.checked=(e.checked?false:true);
				if(choice==3)e.checked=false;
			}
		}
		
		function checkboxIsSelected(){
			var chk = document.theForm.checkboxparam;
		   for (var i=0;i<chk.length;i++) {
		        var e=chk[i];
		        if(e.checked){
			        return true;  
			    }
		   }
		   window.alert('至少选择一项!');
		   return false;
		}
		
		function toPage(){			
			var toPage = document.getElementById('toPage').value;
			var linkStr = document.getElementById('linkStr').value;
			if(toPage != null && toPage != ''){
				if(isNaN(toPage)){
					alert('请输入数字');
					return false;
				}else{
					var link = '/admin/member/member_list.do?method=list&page='+toPage+linkStr;
					window.location.href = link;
					return true;
				}
			}
		}
		
//-->
</script>
</head>
<body>
		<html:form action="/admin/member/member_list.do?method=searchMember">
			会员帐号：<html:text property="GYonghum" value="${bk_GYonghum}" size="6"></html:text>　
			真实姓名：<html:text property="turename" value="${bk_turename}" size="6"></html:text>　
			锁定：<html:select property="ifdel">
					<option value="-1">选</option>
					<option value="1" <c:if test="${bk_ifdel ==1}">selected</c:if>>是</option>
					<option value="0" <c:if test="${bk_ifdel ==0}">selected</c:if>>否</option>
				</html:select>
						<html:submit value="给我搜" />
	    </html:form>
	
	<c:set var="linkStr" value="&bk_GYonghum=${bk_GYonghum}&bk_turename=${bk_turename}&bk_ifdel=${bk_ifdel}"></c:set>
	<form action="member_list.do?method=deleteMember&page=${curPage}${linkStr}" name="theForm" method="post">

		<input type="hidden" value="${linkStr}" id="linkStr"/>
		<table width="100%" border="1" align="center" cellpadding="0"
			cellspacing="0">
			<tr align="center">
				<td width="4%" height="30">
					选
				</td>
				<td width="5%">
					<b>ID</b>
				</td>
				<td width="8%">
					会员帐号
				</td>
				<td width="8%">
					真实姓名
				</td>
				<td width="8%">
					登陆次数
				</td>
				<td width="12%">
					注册时间
				</td>
				<td width="13%">
					最后登陆时间
				</td>
				<td width="12%">
					最后登陆IP
				</td>
				<td width="5%">
					锁定
				</td>
				<td width="5%">
					编辑
				</td>
				<td width="5%">
					改密
				</td>
			</tr>
			<tbody>
				
				<logic:present name="gerenbiao_list">
					<logic:iterate id="list" name="gerenbiao_list">
						<tr align="center" height="20">
							<td><input type="checkbox" name="checkboxparam" value="${list.GUserid}"></td>
							<td><bean:write name="list" property="GUserid" /></td>
							<td>
								<a href="member_list.do?method=showGerenDetail&id=${list.GUserid}" target="_blank">
								<bean:write name="list" property="GYonghum" /></a>
							</td>
							<td>
								<c:if test="${list.turename == null || list.turename == ''}">　</c:if>
								<c:if test="${list.turename != null && list.turename != ''}">${list.turename}</c:if>
							</td>
							<td>
								<c:if test="${list.loginnum == null || list.loginnum == '' ||list.loginnum < 1}">0</c:if>
								<c:if test="${list.loginnum > 0}">${list.loginnum}</c:if>
							</td>
							<td><bean:write name="list" property="addtime" format="yyyy年MM月dd日" /></td>
							<td><bean:write name="list" property="logintime" format="yyyy年MM月dd日" /></td>
							<td><bean:write name="list" property="ip" /></td>
							<td>
								<c:if test="${list.ifdel == 1}">★</c:if>
								<c:if test="${list.ifdel != 1}">☆</c:if>
							</td>
							<td>
								<a href="member_list.do?method=toEditMember&id=${list.GUserid}&page=${curPage}${linkStr}">
								<img src="/admin/images/edititem.gif" title="编辑"/></a>
							</td>
							<td>
								<a href="member_list.do?method=toEditMemberPwd&id=${list.GUserid}&page=${curPage}${linkStr}">
								<img src="/admin/images/edititem.gif" title="密码初始化"/></a>
							</td>
						</tr>
					</logic:iterate>
				</logic:present>
			</tbody>
		</table>
		<table width="100%" border="1" align="center" cellpadding="0"
			cellspacing="0">
			<tr>
				<td height="4"></td>
			</tr>
			<logic:present name="gerenbiao_list">
				<tr>
					<td>
						<html:button onclick="selectAll(1);" property="button" value="全选" />
						&nbsp;
						<html:button onclick="selectAll(2);" property="button" value="反选" />
						&nbsp;
						<html:button onclick="selectAll(3);" property="button" value="不选" />
						&nbsp;
						<input type="submit" value="设置/取消锁定" name="submit"
							onclick="return checkboxIsSelected();">
					</td>
				</tr>
			</logic:present>
		</table>
	</form>

	<table width="100%" border="1" align="center" cellpadding="0"
		cellspacing="0">
		<tr>
			<logic:present name="curPage">
				<td colspan="8" align="center">
				当前是第  <font color="red">${curPage}</font>　/　${allPage} 页　　
				<c:if test="${curPage<2}"> 首页 </c:if>
				<c:if test="${curPage>1}">
					<html:link href="/admin/member/member_list.do?method=list&page=${1}${linkStr}">首页</html:link>　
				</c:if>
				<c:if test="${curPage<2}">上一页</c:if>
				<c:if test="${curPage>1}">
					<html:link href="/admin/member/member_list.do?method=list&page=${backPage}${linkStr}">上一页</html:link>　
				</c:if>
				<c:if test="${curPage==allPage}"> 下一页 </c:if>
				<c:if test="${curPage<allPage}">
					<html:link href="/admin/member/member_list.do?method=list&page=${nextPage}${linkStr}">下一页</html:link>  
				</c:if>
				<c:if test="${curPage==allPage}"> 末页 </c:if>
				<c:if test="${curPage<allPage}">
					<html:link href="/admin/member/member_list.do?method=list&page=${allPage}${linkStr}">末页</html:link> 
				</c:if>
				　　跳转到第 
				<input id="toPage" size="4" maxlength="4" /> 页 <input type="button" value="查 看" onclick="return toPage();">
			</td>
			</logic:present>			
		</tr>
	</table>
	
	<logic:present name="msg">
		<bean:write name="msg" filter="false" />
	</logic:present>
	
</body>
</html:html>
